package org.example.memora.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.example.memora.entity.CommunityUser;

import java.util.List;

public interface CommunityUserMapper extends BaseMapper<CommunityUser> {
    CommunityUser selectById(Long id);
    List<CommunityUser> selectByCommunityId(Long communityId);
    int insert(CommunityUser user);
    int deleteByCommunityIdAndUserId(Long communityId, Long userId);

    int updateById(CommunityUser user);

    List<Long> selectDistinctCommunityIdsByRoleAndUserId(@Param("role") String role, @Param("userId") Long userId);


    CommunityUser selectByCommunityIdAndUserId(Long communityId, Long userId);
}
